<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<h:form prependId="false" id="transactionForm">
		<p:panel id="transactionData" toggleable="true" toggleSpeed="250">
			<f:facet name="header">
				<h:outputText value="#{messages.label_menu_transactions}" />
			</f:facet>
			<h:outputFormat id="noTransactionRecordsFound"
				value="#{messages.label_no_records_found}"
				rendered="#{empty bankTransactionBean.transactions}">
				<f:param value="BankTransactions" />
			</h:outputFormat>
			<p:dataTable id="transactionList" value="#{bankTransactionBean.transactions}"
				var="bankTransaction" rendered="#{not empty bankTransactionBean.transactions}"
				widgetVar="bankTransactionTable" resizableColumns="false"
				paginator="true"
				paginatorTemplate=" {CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="5,10,25,50" rows="#{rowsPerPage}"
				filteredValue="#{bankTransactionBean.filteredBankTransactions}">

				<p:column id="accountnoCol" headerText="#{messages.label_accountno}"
					filterBy="#{bankTransaction.accountNumber}"
					filterOptions="#{accountBean.accountItems}" filterMatchMode="exact">
					<h:outputText value="#{bankTransaction.accountNumber}" />
				</p:column>

				<p:column id="bookingDateCol" headerText="#{messages.label_bdate}">
					<h:outputText value="#{bankTransaction.bookingDate}"
						converter="dateConverter" />
				</p:column>

				<p:column id="valutaDateCol" headerText="#{messages.label_vdate}">
					<h:outputText value="#{bankTransaction.valutaDate}"
						converter="dateConverter" />
				</p:column>

				<p:column id="amountCol" headerText="#{messages.label_amount}">
					<h:outputText value="#{bankTransaction.bookedValueAsString}"
						style="font-weight:bold; color: #{bankTransaction.deduction ? 'red' : 'green'};" />
				</p:column>

				<p:column id="usageCol" headerText="#{messages.label_usage}">
					<h:outputText value="#{bankTransaction.bookingDescription}"
						style="font-size: xx-small;" />
					<br />
					<h:outputText value="#{bankTransaction.otherInstituteName}"
						style="font-size: xx-small;" />
					<br />
					<h:outputText value="#{bankTransaction.usageText}"
						style="font-size: xx-small;" />
				</p:column>

				<p:column styleClass="action-column">
					<f:facet name="header">
						<h:outputText value="Actions" />
					</f:facet>
					<p:commandButton id="transactionViewButton" icon="ui-icon-zoomin"
						update=":transactionViewForm:transactionViewPanelGrid"
						oncomplete="transactionViewDialogWidget.show()"
						title="#{messages.label_view}"
						immediate="true"
						
						action="#{bankTransactionBean.testAction}">
						<f:setPropertyActionListener value="#{bankTransaction}"
							target="#{bankTransactionBean.bankTransaction}" />
					</p:commandButton>
					<p:tooltip for="transactionViewButton"
						value="#{messages.label_view}" showEffect="fade" hideEffect="fade" />
				</p:column>
			</p:dataTable>
		</p:panel>
	</h:form>
</ui:composition>
